export default ({$axios}, inject) => {

  // 用户注册/修改手机号码 - 获取手机短信验证码  {phone}
  inject('sendPhoneCode', phone => $axios.$get(`/sms/api/send/${phone}`))
  // 用户注册
  inject('userRegister', data => $axios.$post(`/system/api/user/register`, data))

  // 用户登录 - 获取图灵验证码 (  @RequestParam 传参方式 ）
  inject('getCaptcha', (loginInfo) => $axios.$get(`/system/api/user/captcha`, {params: loginInfo}))
  // 用户登录
  inject('userLogin', data => $axios.$post(`/system/api/user/login`, data))
  // 通过 token 获取用户信息(没用，用户登录直接返回 token 和用户信息)
  // inject('getUserInfo', () => $axios.$get(`/system/user/info/by/token`))

  // 退出登录
  inject('logout', () => $axios.$delete(`/system/user/logout`))

  // 用户找回密码 - 发送手机短信验证码
  inject('sendFindPasswordByPhoneCode', phone => $axios.$get(`/sms/api/send/update/password/${phone}`))
  // 用户手机验证码找回密码
  inject('userFindPasswordByPhoneCode', data => $axios.$post(`/system/api/user/findPasswordByPhoneCode`, data))
  // 用户找回密码 - 发送邮箱验证码
  inject('sendEmailCode', email => $axios.$get(`/sms/api/sendMailCode/${email}`))
  // 用户邮箱找回密码
  inject('userFindPasswordByEmailCode', data => $axios.$post(`/system/api/user/findPasswordByEmailCode`, data))

  // 新增赞助1元 /system/patron/add
  inject('addPatron', data => $axios.$post(`/system/patron/add`, data))
  // 新增VIP赞助人
  inject('addSponsor', data => $axios.$post(`/system/sponsor/add`, data))
  // 赞助1元列表
  inject('getPatronListPage', (current, size, query) => $axios.$get(`/system/api/patron/list/${current}/${size}`, {params: query}))
  // VIP赞助人列表
  inject('getSponsorListPage', (current, size, query) => $axios.$get(`/system/api/sponsor/list/${current}/${size}`, {params: query}))

  // 用户投放轮播图片
  inject('addLooper', data => $axios.$post(`/article/looper/add`, data))
  // 门户网站 - 投放轮播图页面 - Top15轮播图信息
  inject('getLooperTop15List', () => $axios.$get(`/article/api/looper/top15`))
  // 门户网站 - 条件分页查询 - 已审核通过的所有轮播图列表
  inject('getLooperListPage', (current, size, query) => $axios.$get(`/article/api/looper/list/${current}/${size}`, {params: query}))

  // 个人主页-根据路由用户ID-获取用户基本信息
  inject('getUserInfoByRouteId', userId => $axios.$get(`/system/api/user/info/${userId}`))
  // 个人主页-奖励用户
  inject('addUserAward', data => $axios.$post(`/article/award/add-user/`, data))
  // 个人主页-统计-文章微服务
  inject('statisticCountArticle', userId => $axios.$get(`/article/api/statistic/total/${userId}`))
  // 个人主页-统计-用户微服务
  inject('statisticCountUser', userId => $axios.$get(`/system/api/user/total/${userId}`))

  // 个人主页-文章列表
  inject('getUserArticleList', (routeId, userId, current, size, query) => $axios.$get(`/article/api/article/user/${routeId}/${userId}/${current}/${size}`, {params: query}))
  // 个人主页-条件分页查询留言列表
  inject('getUserCommentList', (routeId, userId, current, size, query) => $axios.$get(`/article/api/comment/user/${routeId}/${userId}/${current}/${size}`, {params: query}))
  // 个人主页-关注人列表
  inject('getUserFolloweeList', (routeId, current, size, userId) => $axios.$get(`/system/api/follow/followee/list/${routeId}/${current}/${size}/${userId}`))
  // 个人主页-粉丝列表
  inject('getUserFollowerList', (routeId, current, size, userId) => $axios.$get(`/system/api/follow/follower/list/${routeId}/${current}/${size}/${userId}`))
  // 个人主页-收到的赞
  inject('getUserThumbList', (userId, current, size) => $axios.$get(`/article/api/thumb/user/list/${userId}/${current}/${size}`))
  // 个人主页-点过的赞
  inject('getUserDoThumbList', (userId, current, size) => $axios.$get(`/article/api/thumb/do/list/${userId}/${current}/${size}`))
  // 个人主页-收到的奖励
  inject('getUserAwardList', (userId, current, size) => $axios.$get(`/article/api/award/user/list/${userId}/${current}/${size}`))
  // 个人主页-奖励列表
  inject('getUserDoAwardList', (userId, current, size) => $axios.$get(`/article/api/award/do/list/${userId}/${current}/${size}`))
  // 个人主页-收藏列表
  inject('getUserDoCollectList', (userId, current, size) => $axios.$get(`/article/api/collect/do/list/${userId}/${current}/${size}`))
  // 个人主页-用户赞助1元列表
  inject('getUserPatronList', (userId, current, size) => $axios.$get(`/system/api/patron/list/${userId}/${current}/${size}`))
  // 个人主页-用户VIP赞助列表
  inject('getUserSponsorList', (userId, current, size) => $axios.$get(`/system/api/sponsor/list/${userId}/${current}/${size}`))
  // 个人主页-用户投图赞助列表
  inject('getUserLooperList', (userId, current, size) => $axios.$get(`/article/api/looper/list/${userId}/${current}/${size}`))

  // 私人空间-动态流
  inject('getUserAndFolloweeArticleList', (userId, current, size) => $axios.$get(`/article/article/user/${userId}/${current}/${size}`))
  // 私人空间-草稿-用户草稿列表（包括审核未通过的文章）
  inject('getUserDraftArticleList', (userId, current, size) => $axios.$get(`/article/article/user/draft/${userId}/${current}/${size}`))
  // 私人空间-轮播图-用户所有投放的轮播图
  inject('getUserAllLooperList', (userId, current, size) => $axios.$get(`/article/looper/user/all/${userId}/${current}/${size}`))
  // 私人空间-轮播图-根据ID-删除轮播图
  inject('removeUserLooperById', (id) => $axios.$delete(`/article/looper/remove/${id}`))
  // 私人空间-轮播图-根据ID-查询编辑状态的轮播图详情
  inject('getEditUserLooperById', (looperId) => $axios.$get(`/article/looper/${looperId}`))
  // 私人空间-轮播图-根据ID-编辑轮播图
  inject('updateLooperById', data => $axios.$put(`/article/looper/update`, data))

  // 私人空间-设置-用户修改用户名
  inject('updateUsername', (data) => $axios.$post(`/system/user/update/username`, data))
  // 私人空间-设置-用户修改个性签名
  inject('updateUserSign', (data) => $axios.$post(`/system/user/update/sign`, data))
  // 私人空间-设置-用户修改邮箱-发送邮箱验证码
  inject('updateEmailSendCode', email => $axios.$get(`/sms/api/update/send-mailCode/${email}`))
  // 私人空间-设置-用户修改邮箱
  inject('updateEmailByEmailCode', data => $axios.$post(`/system/user/updateEmailByEmailCode`, data))
  // 私人空间-设置-用户修改手机号码
  inject('updatePhoneByPhoneCode', data => $axios.$post(`/system/user/updatePhoneByPhoneCode`, data))
  // 私人空间-设置-用户修改密码
  inject('updatePassword', data => $axios.$post(`/system/user/updatePassword`, data))
  // 私人空间-设置-用户修改头像
  inject('updateAvatar', data => $axios.$post(`/system/user/update/avatar`, data))
  // 私人空间-设置-用户修改赞赏
  inject('updateReward', data => $axios.$post(`/system/user/update/reward`, data))

  // 私信-会话列表
  inject('getUserConversationList', (current, size) => $axios.$get(`/system/message/conversations/${current}/${size}`))
  // 私信-会话列表页面-新增私信
  inject('addMessage', (data) => $axios.$post(`/system/message/save`, data))
  // 私信-根据会话ID-批量删除私信
  inject('removeByConversationId', (conversationId) => $axios.$delete(`/system/message/remove/${conversationId}`))
  // 私信-某会话-私信详情列表
  inject('getMessageDetailsByConversationId', (current, size, conversationId) => $axios.$get(`/system/message/details/${current}/${size}/${conversationId}`))
  // 私信详情-根据ID删除私信
  inject('removeMessageById', (id) => $axios.$delete(`/system/message/details/remove/${id}`))

  // 系统通知-分类通知列表-显示各分类最新一条通知信息
  inject('getUserNoticeTypeList', () => $axios.$get(`/system/notice/type`))
  // 系统通知-所有未读系统通知总数+所有未读私信总数（顶部导航）
  inject('getUserAllNoticeUnreadCount', (userId) => $axios.$get(`/system/api/notice/unread/count/${userId}`))
  // 系统通知详情-某类通知详情列表
  inject('getUserNoticeDetails', (current, size, type) => $axios.$get(`/system/notice/details/${current}/${size}/${type}`))
  // 系统通知详情-根据ID删除私信
  inject('removeNoticeById', (id) => $axios.$delete(`/system/notice/user/remove/${id}`))

  // 隐藏设置-设置隐藏
  inject('updatePrivacy', data => $axios.$put(`/system/privacy/update`, data))
  // 隐藏设置-根据用户ID查询隐私状态
  inject('getPrivacyStatus', (userId) => $axios.$get(`/system/api/privacy/${userId}`))

}
